package com.hos.punchtheclocksystem.service.impl;

import com.hos.punchtheclocksystem.mapper.MyMapper;
import com.hos.punchtheclocksystem.pojo.Card;
import com.hos.punchtheclocksystem.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class MyServiceImpl implements MyService {
    @Autowired
    MyMapper mapper;

    @Override
    public Integer punchCard(Card card) {
        return mapper.insert(card);
    }

    @Override
    public List<Card> selectYourselfProceedingByDocId(Integer DocId) {
        return mapper.selectYourselfProceedingByDocId(DocId);
    }

    @Override
    public List<Card> selectAllCard() {
        return mapper.selectAll();
    }

    @Override
    public int delete(Integer[] ids) {
        return mapper.delete(ids);
    }

    public int deleteByWorkerIdToday(Integer worker_id){
        return mapper.deleteCardByWorkerIdToday(worker_id);
    }

    @Override
    public Card selectCardToday(Integer worker_id){
        return mapper.selectCardToday(worker_id);
    }

    public Card oldOrYesterday(Integer worker_id){
        return mapper.oldOrYesterday(worker_id);
    }


}
